import request from '@/utils/http'

// 查询分页-活动信息
export function activityListApi(data) {
	return request({
		url: `/app/activity/page`,
		method: 'get',
		data
	})
}

// 查询-活动详细（带报名人员信息）
export function activityDetailApi(id) {
	return request({
		url: `/app/activity/details/${id}`,
		method: 'get'
	})
}

// 检测-用户是否已经报名
export function hasEnrollApi(data) {
	return request({
		url: `/app/activity/check/isEnroll`,
		method: 'get',
		data
	})
}

// 检测-当前时间活动能否报名
export function timeEnrollApi(data) {
	return request({
		url: `/app/activity/check/entryTime`,
		method: 'get',
		data
	})
}

// 报名活动
export function signUpApi(data) {
	return request({
		url: '/app/activity/add/enroll',
		method: 'post',
		data
	})
}

// 取消报名
export function cancelSignUpApi(activityId) {
	return request({
		url: '/app/activity/cancel/enroll',
		method: 'delete',
		data: {
			activityId: activityId
		}
	})
}

// 分页查询-我的活动
export function myActivitysApi(data) {
	return request({
		url: `/app/activity/myPage`,
		method: 'get',
		data
	})
}

// 新增-活动（会进入待审核状态）
export function createActivityApi(data) {
	return request({
		url: '/app/activity',
		method: 'post',
		data
	})
}

// 删除活动申请 提单
export function deleteActivityApi(data) {
	return request({
		url: '/app/cancellation/activityRemove/apply',
		method: 'post',
		data
	})
}

// 签到活动
export function verifyActivityApi(data) {
	return request({
		url: '/app/activity/signIn',
		method: 'put',
		data
	})
}